Repository navigation
crypto: primitives - RFC 8439's raw ChaCha20 and Poly1305: ciphers::chacha20 on libsodium, BearSSL and OpenSSL, authenticators::poly1305 on libsodium and OpenSSL - #30
Merged
Conversation
added 26 commits
December 5, 2026 01:26
…, the concept stream_cipher and its free form, on libsodium
…'s internal linkage, trailing commas
…al on a backend that completes by itself
… three backends, NIP-44 composed in the tests alone
…er memcheck and MemorySanitizer, OpenSSL under memcheck) and in dudect
…the concept single_use_key_authenticator and its free forms, on libsodium
…'s refusal pinned, the stream cipher's fallbacks, BearSSL's code paths checked, NIP-44's keys wiped
… free verify's guard covered
… composed from the raw pieces as an 18-cell cross-backend test, the asynchronous forms and the refusal on a backend that completes by itself
…s a macro (near), so composition_rfc8439 compiles on MSVC
…and MemorySanitizer, OpenSSL under memcheck) and in dudect
… brief kept apart, the error completions posted, makes_empty_v through friendship
…afe_value, which clang-tidy's exception-escape accepts in a noexcept from_key
… the sizes and bench programs
…ds, RFC 8439's lengths unpadded
…nd that completes by itself, OpenSSL's ChaCha20 in pieces of 2^30, the synchronous verify's refusal pinned
…oly1305's message pointer named apart from a program's globals
…ax, the lint told so
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
crypto's change primitives (proposals: libraries/crypto/openspec/changes/primitives), Tasks 1-13 of its plan: RFC 8439's raw ChaCha20 and Poly1305.
ciphers::chacha20<>(basic_chacha20<Family, Backend>), RFC 8439's raw stream cipher, in the newcrypto::unauthenticated_encryptionwith the conceptstream_cipherand the free formsapply_keystream/async_apply_keystream; the concept and free forms read the algorithm's ownnonce_size,block_sizeandcounter_type(owner decision 7), the counter's end computed bydetail::counter_overflows,error::counter_overflow(22) when it would wrap. On libsodium (the default on every target), BearSSL and OpenSSL; OpenSSL runs in pieces of 2^30 bytes.authenticators::poly1305<Backend>, RFC 8439's one-time authenticator (owner decision 6): no object, staticauthenticateandverify, in the newcrypto::single_use_key_authenticationwith the conceptsingle_use_key_authenticatorand its four forms. On libsodium and OpenSSL; BearSSL refused by name.bool = asynchronous_backend_v<Backend>, so the engine's generated refusal stays silent there (found by the final review; pinned by message tests).Verification, all local and green on this head: five local lanes (clang 776, gcc-15 550, wasip2 723, wasip3 705, emscripten 455, 0 failed), agreement at release, c-suites, docs and tools tests, both full lints, Linux constant-time, Mac dudect, MSVC 14.3 and 14.5 x64 debug, arm64 14.5 timing set (table: proposals' reference/STATUS.md). No CI ran: the owner's one CI on main comes at the end.
🤖 Generated with Claude Code